<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
Quickstart
</title><link rel="stylesheet" type="text/css" href="stylesheet.css" />
<!-- [search] { -->
<script type="text/javascript" src="navigation.js"></script>
</head><body onload="highlight()" onscroll="scroll()">

<table class="nav" onmousemove="return mouseMove(event)"><tr class="nav"><td class="nav" valign="top">
<div id = "searchMenu" style="width: 180px; overflow: hidden;">
<div class="menu" style="white-space:nowrap;">
<img src="images/h2-logo-2.png"
    alt="H2 database logo"
    onclick="document.location='main.html'"
    width="136" height="74"/> &nbsp;&nbsp;<span id = "goTop" onclick="window.scrollTo(0,0)" style="color: #fff; position:fixed; font-size: 20px; cursor: pointer;">&#x25b2;</span> </div>

<form action="submit" onsubmit="return goFirst();">
<table width="100%" class="search">
    <tr class="search">
        <td class="search" colspan="2">
<!-- translate
<a href="http://translate.google.com/translate?u=http%3A%2F%2Fh2database.com"
    onclick="javascript:startTranslate();return false;">Translate</a>
<div id = "translate" style="display:none"><div id = "google_translate_element"></div></div>
translate -->
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
        <b><label for="search">Search:</label></b>
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
            <input id = "search" name="search" type="text" size="16" maxlength="100" onkeyup="listWords(this.value, '')" /><br />
            <input type="reset" id = "clear" style="display:none;" value="Clear" onclick="listWords('', '');" />
        </td>
    </tr>
    <tr class="search" style="display:none;" >
        <td class="search" style="width: 1%; vertical-align: middle;">
            <input id = "highlight" type="checkbox" checked="checked" onclick="highlightCurrent(this.checked, search.value)" />
        </td>
        <td class="search" style="width: 99%; padding: 0px; vertical-align: middle;">
            <label for="highlight">Highlight keyword(s)</label>
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
            <table id = "result" style="border: 0px;">
                <tr style="display:none"><td></td></tr>
            </table>
        </td>
    </tr>
</table>
</form>
<div class="menu">
<b><a href="main.html">Home</a></b><br />
<a href="download.html">Download</a><br />
<a href="cheatSheet.html">Cheat Sheet</a><br />
<br />
<b>Documentation</b><br />
<a href="quickstart.html">Quickstart</a><br />
<a href="installation.html">Installation</a><br />
<a href="tutorial.html">Tutorial</a><br />
<a href="features.html">Features</a><br />
<a href="performance.html">Performance</a><br />
<a href="advanced.html">Advanced</a><br />
<br />
<b>Reference</b><br />
<a href="grammar.html">SQL Grammar</a><br />
<a href="functions.html">Functions</a><br />
<a href="datatypes.html">Data Types</a><br />
<a href="../javadoc/index.html">Javadoc</a><br />
<a href="../h2.pdf">PDF (1 MB)</a><br />
<br />
<b>Support</b><br />
<a href="faq.html">FAQ</a><br />
<a href="sourceError.html">Error Analyzer</a><br />
<a href="http://groups.google.com/group/h2-database">Google Group (English)</a><br />
<a href="http://groups.google.co.jp/group/h2-database-jp">Google Group (Japanese)</a><br />
<a href="http://groups.google.com/group/h2-cn">Google Group (Chinese)</a><br />
<br />
<b>Appendix</b><br />
<a href="history.html">History &amp; Roadmap</a><br />
<a href="license.html">License</a><br />
<a href="build.html">Build</a><br />
<a href="links.html">Links</a><br />
<a href="jaqu.html">JaQu</a><br />
<a href="mvstore.html">MVStore</a><br />
<br />

</div>
</div>
</td>

<td class="nav" style="cursor: e-resize;" onmousedown="return mouseDown(event)" onmouseup="return mouseUp(event)">&nbsp;</td>
<td class="nav"><div class="content">

<!-- } -->

<h1>Quickstart</h1>
<a href="#embedding"> Embedding H2 in an Application</a><br />
<a href="#h2_console"> The H2 Console Application</a><br />

<h2 id="embedding">Embedding H2 in an Application</h2>
<p> This database can be used in embedded mode, or in server mode. To use it in embedded mode, you need to: </p>
<ul>
<li>Add the <code>h2*.jar</code> to the classpath (H2 does not have any dependencies) </li><li>Use the JDBC driver class: <code>org.h2.Driver</code> </li><li>The database URL <code>jdbc:h2:~/test</code> opens the database <code>test</code> in your user home directory </li><li>A new database is automatically created </li></ul>

<h2 id="h2_console">The H2 Console Application</h2>
<p> The Console lets you access a SQL database using a browser interface. <br />
<img src="images/console-2.png"
    width="535" height="179"
    alt="Web Browser - H2 Console Server - H2 Database" />
<br /> If you don't have Windows XP, or if something does not work as expected, please see the detailed description in the <a href="tutorial.html">Tutorial</a>. </p>

<h3>Step-by-Step</h3>

<h4>Installation</h4>
<p> Install the software using the Windows Installer (if you did not yet do that). </p>

<h4>Start the Console</h4>
<p> Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]:<br />
<img class="screenshot" src="images/quickstart-1.png" alt="Screenshot: start H2 Console" /><br /> A new console window appears:<br />
<img class="screenshot" src="images/quickstart-2.png" alt="Screenshot: H2 running" /><br /> Also, a new browser page should open with the URL <a href="http://localhost:8082" class="notranslate">http://localhost:8082</a>. You may get a security warning from the firewall. If you don't want other computers in the network to access the database on your machine, you can let the firewall block these connections. Only local connections are required at this time. </p>

<h4>Login</h4>
<p> Select [Generic H2] and click [Connect]:<br />
    <img class="screenshot" src="images/quickstart-3.png" alt="Screenshot: login" /><br /> You are now logged in. </p>

<h4>Sample</h4>
<p> Click on the [Sample SQL Script]:<br />
    <img class="screenshot" src="images/quickstart-4.png" alt="Screenshot: click on the sample SQL script" /><br /> The SQL commands appear in the command area.<br />
</p>

<h4>Execute</h4>
<p> Click [Run]<br />
<img class="screenshot" src="images/quickstart-5.png" alt="Screenshot: click Run" /><br /> On the left side, a new entry TEST is added below the database icon. The operations and results of the statements are shown below the script.<br />
<img class="screenshot" src="images/quickstart-6.png" alt="Screenshot: see the result" /><br />
</p>

<h4>Disconnect</h4>
<p> Click on [Disconnect]:<br />
<img src="images/icon_disconnect.gif" alt="Disconnect icon" /><br /> to close the connection. </p>

<h4>End</h4>
<p> Close the console window. For more information, see the <a href="tutorial.html">Tutorial</a>. </p>

<!-- [close] { -->
</div></td></tr></table>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="search.js"></script>
<script type="text/javascript">
function startTranslate() {
    document.getElementById('translate').style.display='';
    var script=document.createElement('script');
    script.setAttribute("type","text/javascript");
    script.setAttribute("src", "http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit");
    document.getElementsByTagName("head")[0].appendChild(script);
}
function googleTranslateElementInit() {
    new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>

<!-- } --><!-- analytics --></body></html>

